﻿
CREATE PROCEDURE [dbo].[proc_Employee_WageTempZj_Create]
	(
		@UserName nvarchar(50),
		@CategoryId int,
		@Price numeric(18,2),
		@Memo nvarchar(50),
		@FsDate DateTime,
		@CreateName nvarchar(50)
	)
AS
	
	Declare @CompanyName nvarchar(50),@EName nvarchar(50),@CategoryName nvarchar(50),@CompanyId int
	
	
	Select @EName= EName,@CompanyId=CompanyId From Employee Where UserName=@UserName

	Select @CompanyName= CompanyName From Company Where Id=@CompanyId
	Select @CategoryName= Title From Employee_WageTempZj_Category Where Id=@CategoryId
	
	Insert Into Employee_WageTempZj (CompanyId,CompanyName,UserName,EName,CategoryId,CategoryName,Price,Memo,FsDate,CreateName,CreateDate)
	Values(@CompanyId,@CompanyName,@UserName,@EName,@CategoryId,@CategoryName,@Price,@Memo,@FsDate,@CreateName,Getdate())
	
	RETURN

